import { menuModel } from "./../model/SysMenuModel";

export class SysMenuService {

    async menuList() {

        let menu:any = await menuModel.find({});

        return menu; 
    }

    async menu_two_list(nId:number) {

        let menu:any = await menuModel.find({pId : nId});

        return menu; 
    }

    async createMenu(res) {

        let menu = await menuModel.create({nId : 5 ,pId : 4,name : 'Ding',menuCode:'',url:'',orderNo:1,enable:1,createDate:new Date().getTime()});

        return { code: 100, msg: 'success',menu}; 
    }

}



let sysMenuService = new SysMenuService();
export default sysMenuService;